﻿#region 命名空间

using System;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;


#endregion

namespace WinnerCMS.BLL
{
    /// <summary>
    /// 用户操作日志
    /// </summary>
    [AttributeUsage(AttributeTargets.Method)]
    public class LoggingAttribute : HandlerAttribute
    {
        public LoggingAttribute()
        {
            Event = string.Empty;
            Order = 0;
        }

        public LoggingAttribute(string _Event)
        {
            Event = _Event;
            Order = 0;
        }

        /// <summary>
        /// 分类
        /// </summary>
        public string Event { get; set; }


        public override ICallHandler CreateHandler(IUnityContainer container)
        {
            LoggingHandler handler = new LoggingHandler(Event)
            {
                Order = Order
            };

            return handler;
        }
    }
}